def fun1(n):
    for i in range(1, n + 1,1):
        for j in range(n, 0,-1):
            if j > i:
                print(' ' * len(str(j)), end=' ')
            else:
                print(j, end=' ')
        print()
    print('~'*100)
    for i in range(n,0,-1):
        for j in range(n,0,-1):
            if j>i:
                print(' ' * len(str(j)), end=' ')
            else:
                print(j,end=' ')
        print()
fun1(15)


# 做的不错,不过变量名与函数名再标准一些,就更完美了